<!--onblur只要点击文本框再点出去,就会触发-->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>onclick事件注册</title>
    <script type="text/javascript">
        function onblurFunc() {
            console.log("这是一个静态onblur事件");
        }

        window.onload = function () {
            var blurObj = document.getElementById("id0001");
            blurObj.onblur = function () {
                console.log("这是一个动态onblur事件");
            }
        }

    </script>
</head>
<body>
<input type="text" onblur="onblurFunc();" value="静态onblur"/><br/>
<input type="text" id="id0001" value="动态onblur"/><br/>
</body>
</html>